<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<progress value="" width="100" height="20" max=""></progress>
		<script>
			//progress 进度条
			
			
			var xhr = new XMLHttpRequest();
			var url = 'abcde.mp3';
			xhr.open('get',url,true);
			xhr.send();
			
			xhr.addEventListener('readystatechange',function (e){
				var res = e.target;
				console.log(res);
				if ( res.readyState == 4 ){
					if ( res.state == 200 ){
						console.log('请求成功');
					}
				}
			});   
			var progress = document.querySelector('progress');
			xhr.addEventListener('progress',function(e){
				if (e.lengthComputable){
					progress.max = e.total;
					progress.value = e.loaded;
				}
			});
		</script>
	</body>
</html>
